<?php 

namespace Admin\Controller;
use Common\Controller\AdminBaseController;

class OrderController extends AdminBaseController {
//订单展示页面
	public function index(){
		$sear=I('post.search');
		$map['ordnum']=array('LIKE',"%$sear%");
		$count= M('order')->where($map)->count();
	    $size=5;
	    $page=ceil($count/$size);
	    $this->assign('sear',$sear);
	    $this->assign('show',$page);
	    $this->display();
    }

	public function doindex(){
		$sear=I('get.sear');
		$map['ordnum']=array('LIKE',"%$sear%");
		$list=M('order')->where($map)->page(I('get.p',1),5)->select();
      	$this->ajaxReturn($list);
	}

	public function more(){
		$oid=I('get.oid');
		$res=M('order')->where("oid = {$oid}")->find();
		$arr=json_decode($res['content'],true);
		$this->assign('plist',$arr);
		$this->assign('list',$res);
		$this->display();
	}
	public function ordsend(){
		$id=I('post.ordid');
		$da['effect']=3;
		$res = M('order')->where(" oid = $id")->save($da);
		if($res){
			$re['status']=true;
		}else{
			$re['status']=false;
		}
		$this->ajaxReturn($re);
	}
//一键发货页面
	public function send(){
		$res=M('order')->where("effect = 2")->select();
		$this->assign('list',$res);
		$this->display();
	}
	public function dosend(){
		$arr=I('post.arr');
		$where['oid']=array('in',$arr);
		$da['effect']=3;
		$res = M('order')->where($where)->save($da);

		if($res){
			$re['status']=true;
		}else{
			$re['status']=false;
		}
		$this->ajaxReturn($re);
	}

}














 ?>